package cloud.xlh.my_system.login.facial_recognition.controller;

import cloud.xlh.my_system.login.facial_recognition.service.FacialRecognitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2022/6/26 20:12
 * @ Description:
 */
@RestController
@RequestMapping("/facialRecognitionBusiness")
public class FacialRecognitionBusinessController {
    @Autowired
    private FacialRecognitionService facialRecognitionService;


    @RequestMapping(value = "doRegister",method = RequestMethod.POST)
    public String doRegister(String userName,String faceBase) throws IOException {
        return facialRecognitionService.register(userName , faceBase);
    }

    @RequestMapping(value = "doLogin",method = RequestMethod.POST)
    public String doLogin(String faceBase) {
        return facialRecognitionService.login(faceBase);
    }
}
